<?php
namespace app\home\validate;
use think\Validate;

class User extends Validate
{
    protected $rule = [
    'user_name'  => 'require|min:2|max:4',
    'user_tell'  => 'require|length:11|unique:user,user_tell',
    'user_email' => 'require|email',
    'user_pwd'   => 'require|min:6',
    'user_repwd' => 'require|confirm:user_pwd',
    'photocode'  => 'captcha'
    ];

    protected $message = [
    'user_name.require'   => '用户名必须填写',
    'user_name.min'       => '用户名长度不能少于2位',
    'user_name.max'       => '用户名长度最多4位',
    'user_tell.length'    => '电话号码必须11位',
    'user_tell.require'   => '电话号码必须填写',
    'user_tell.unique'    => '该电话号码已被注册',
    'user_email.require'  => '邮箱必须填写',
    'user_email.email'    => '该邮箱为非法邮箱',
    'user_pwd.require'    => '密码必须填写',
    'user_pwd.min'        => '密码长度不能少于6位',
    'user_repwd.require'  => '确认密码必须填写',
    'user_repwd.confirm'  => '两个密码输入必须一致',
    'photocode.captcha'   => '图片验证码错误'
	];
}
?>